package tianwang.util;

import java.io.IOException;
import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class IbatisUtil {
	public static SqlMapClient getCASqlMapClient() throws IOException{
		String resource = "ibatisconfig/caconfig.xml";
		Reader reader = Resources.getResourceAsReader(resource);

		return SqlMapClientBuilder.buildSqlMapClient(reader);
	}
	
	public static SqlMapClient getCocaSqlMapClient() throws IOException{
		String resource = "ibatisconfig/cocaconfig.xml";
		Reader reader = Resources.getResourceAsReader(resource);

		return SqlMapClientBuilder.buildSqlMapClient(reader);
	}
}
